package cc.linker.steplink.crm.merchanth5.pojo;

import cc.linker.steplink.crm.commons.utils.NumberUtils;
import cc.linker.steplink.crm.merchanth5.model.OrderAddressDto;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;

public class MerchantOrderPo {
    private String couponAmount;//优惠券抵扣金额

    private String mallsOrgId;//供货商机构Id

    private String mallsBelongId;//供货商Id

    private Long mallsGoodsId;//供货订单ID

    private Long orderId;//订单ID

    private String orderSn;//商品订单

    private String author;//创作奖励作者/主持人的用户Id

    private Integer orderGoodsType2;

    public Integer getOrderGoodsType2() {
        return orderGoodsType2;
    }

    public void setOrderGoodsType2(Integer orderGoodsType2) {
        this.orderGoodsType2 = orderGoodsType2;
    }

    private String userId;//用户ID

    private Date createTime;//下单时间
    private Date deliveryTime;//发货时间
    private Date finnshedTime;//订单完成时间

    private Date payEndTime;//支付截止时间

    private int orderType;//订单类型 2纯金额

    private int paymentState;//支付状态  0：未付款   1：已付款

    private int chargeType;//支付方式  1支付宝  2微信

    private String outSn;//外部订单号

    private String tradeSn = "";//交易流水号

    private Date payTime;//支付时间

    private String outPaymentCode;//

    private Date finishedTime;//交易完成时间

    private String invoice;//发票信息

    private Integer goodsNum;//商品数量

    private String goodsAmount;//商品总价

    private String orderAmount;//订单应付金额

    private String orderTotalPrice;//订单总价

    private Double shippingFee;//运费

    private Long goodsAmountCent;//商品总价

    private Long orderAmountCent;//订单应付金额

    private Long orderTotalPriceCent;//订单总价

    private Long shippingFeeCent;//运费

    private Integer shippingType;//物流方式 0：无需物流  1：普通快递

    private String shippingCode = "";//快递单号

    private String expressName = "";

    private String orderMessage;//订单留言

    private Integer orderState;//订单状态

    private Integer orderPointscount;//订单积分数

    private Integer refundState;//退款状态
    private String refundAmount;//退款金额
    private Integer refundNum;//退货数量

    private Boolean returnState;//退货状态
    private Integer returnNum;//退货数量

    private String orderFrom;//订单来源

    private Long addressId;//收货地址ID

    private String areaName;//收货区

    private String cityName;//收货市

    private String detailedAddress;//详细地址

    private String phone;//收货手机号

    private String provinceName;//收货省

    private String realName;//收货姓名

    private String payId;

    private String paySn;

    private String cancelCause;//订单取消原因

    private Boolean lockState;

    private Boolean barterState;//换货状态

    private Integer barterNum;//换货数量

    private Integer integralPaymentAmount;//积分抵扣金额（分）

    private String payScoreStr;//积分抵扣金额（元）

    private Integer paymentPoints;//支付积分

    private Integer goodsType;//商品类型

    private String payMessage;//支付留言

    private Long merchantId;//商户ID

    private String customerId;//用户id

    private String orgId;//机构id

    private String salerId;//分销员ID

    private String salerTid;//分销员ID

    private int type;//0：麦爆啦订单，1：非麦爆啦订单

    private int orderGoodsType;//订单商品类型：1.普通订单 2.课程订单（专栏，内容）

    private int isEnd;//订单维权是否结束

    private int isVirtual;//是否虚拟商品

    public String getPayScoreStr() {
        return payScoreStr;
    }

    public void setPayScoreStr(String payScoreStr) {
        this.payScoreStr = payScoreStr;
    }

    public int getIsEnd() {
        return isEnd;
    }

    public void setIsEnd(int isEnd) {
        this.isEnd = isEnd;
    }

    public int getOrderGoodsType() {
        return orderGoodsType;
    }

    public void setOrderGoodsType(int orderGoodsType) {
        this.orderGoodsType = orderGoodsType;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getSalerTid() {
        return salerTid;
    }

    public void setSalerTid(String salerTid) {
        this.salerTid = salerTid;
    }

    public String getSalerId() {
        return salerId;
    }

    public void setSalerId(String salerId) {
        this.salerId = salerId;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    private List<MerchantOrderGoodsPo> orderGoods;

    private OrderAddressDto addressInfo;

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public int getPaymentState() {
        return paymentState;
    }

    public void setPaymentState(int paymentState) {
        this.paymentState = paymentState;
    }

    public String getOutSn() {
        return outSn;
    }

    public void setOutSn(String outSn) {
        this.outSn = outSn;
    }

    public String getTradeSn() {
        return tradeSn;
    }

    public void setTradeSn(String tradeSn) {
        this.tradeSn = tradeSn;
    }

    public String getOutPaymentCode() {
        return outPaymentCode;
    }

    public void setOutPaymentCode(String outPaymentCode) {
        this.outPaymentCode = outPaymentCode;
    }

    public String getInvoice() {
        return invoice;
    }

    public void setInvoice(String invoice) {
        this.invoice = invoice;
    }

    public String getGoodsAmount() {
        return goodsAmount;
    }

    public void setGoodsAmount(String goodsAmount) {
        this.goodsAmount = goodsAmount;
    }

    public String getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(String orderAmount) {
        this.orderAmount = orderAmount;
    }

    public String getOrderTotalPrice() {
        return orderTotalPrice;
    }

//    public void setOrderTotalPrice(Double orderTotalPrice) {
//        this.orderTotalPrice = orderTotalPrice;
//    }

    public Double getShippingFee() {
        return shippingFee;
    }

    public void setShippingFee(Double shippingFee) {
        this.shippingFee = shippingFee;
    }

    public String getOrderMessage() {
        return orderMessage;
    }

    public void setOrderMessage(String orderMessage) {
        this.orderMessage = orderMessage;
    }

    public Integer getOrderState() {
        return orderState;
    }

    public void setOrderState(Integer orderState) {
        this.orderState = orderState;
    }

    public Integer getOrderPointscount() {
        return orderPointscount;
    }

    public void setOrderPointscount(Integer orderPointscount) {
        this.orderPointscount = orderPointscount;
    }

    public Integer getRefundState() {
        return refundState;
    }

    public void setRefundState(Integer refundState) {
        this.refundState = refundState;
    }

    public Boolean getReturnState() {
        return returnState;
    }

    public void setReturnState(Boolean returnState) {
        this.returnState = returnState;
    }

    public String getRefundAmount() {
        return refundAmount;
    }

    public void setRefundAmount(String refundAmount) {
        this.refundAmount = refundAmount;
    }

    public Integer getReturnNum() {
        return returnNum;
    }

    public void setReturnNum(Integer returnNum) {
        this.returnNum = returnNum;
    }

    public String getOrderFrom() {
        return orderFrom;
    }

    public void setOrderFrom(String orderFrom) {
        this.orderFrom = orderFrom;
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public String getPayId() {
        return payId;
    }

    public void setPayId(String payId) {
        this.payId = payId;
    }

    public String getPaySn() {
        return paySn;
    }

    public void setPaySn(String paySn) {
        this.paySn = paySn;
    }

    public String getCancelCause() {
        return cancelCause;
    }

    public void setCancelCause(String cancelCause) {
        this.cancelCause = cancelCause;
    }

    public Boolean getLockState() {
        return lockState;
    }

    public void setLockState(Boolean lockState) {
        this.lockState = lockState;
    }

    public Boolean getBarterState() {
        return barterState;
    }

    public void setBarterState(Boolean barterState) {
        this.barterState = barterState;
    }

    public Integer getBarterNum() {
        return barterNum;
    }

    public void setBarterNum(Integer barterNum) {
        this.barterNum = barterNum;
    }

    public Integer getIntegralPaymentAmount() {
        return integralPaymentAmount;
    }

    public void setIntegralPaymentAmount(Integer integralPaymentAmount) {
        this.integralPaymentAmount = integralPaymentAmount;
    }

    public Integer getPaymentPoints() {
        return paymentPoints;
    }

    public void setPaymentPoints(Integer paymentPoints) {
        this.paymentPoints = paymentPoints;
    }

    public Integer getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(Integer goodsType) {
        this.goodsType = goodsType;
    }

    public String getPayMessage() {
        return payMessage;
    }

    public void setPayMessage(String payMessage) {
        this.payMessage = payMessage;
    }

    public Integer getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    public List<MerchantOrderGoodsPo> getOrderGoods() {
        return orderGoods;
    }

    public void setOrderGoods(List<MerchantOrderGoodsPo> orderGoods) {
        this.orderGoods = orderGoods;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Date getPayEndTime() {
        return payEndTime;
    }

    public void setPayEndTime(Date payEndTime) {
        this.payEndTime = payEndTime;
    }

    public int getChargeType() {
        return chargeType;
    }

    public void setChargeType(int chargeType) {
        this.chargeType = chargeType;
    }

    public Integer getShippingType() {
        return shippingType;
    }

    public void setShippingType(Integer shippingType) {
        this.shippingType = shippingType;
    }

    public String getShippingCode() {
        return shippingCode;
    }

    public void setShippingCode(String shippingCode) {
        this.shippingCode = shippingCode;
    }

    public String getExpressName() {
        return expressName;
    }

    public void setExpressName(String expressName) {
        this.expressName = expressName;
    }

    public Date getFinishedTime() {
        return finishedTime;
    }

    public void setFinishedTime(Date finishedTime) {
        this.finishedTime = finishedTime;
    }

    public Long getGoodsAmountCent() {
        return goodsAmountCent;
    }

    public void setGoodsAmountCent(Long goodsAmountCent) {
//        DecimalFormat df = new DecimalFormat("#.00");
//        //分转元
//        double s = ((double) goodsAmountCent / 100);
//        this.goodsAmount = Double.valueOf(df.format(s));
        this.goodsAmount = NumberUtils.fenToYuan(goodsAmountCent);
        this.goodsAmountCent = goodsAmountCent;
    }

    public Long getOrderAmountCent() {
        return orderAmountCent;
    }

    public void setOrderAmountCent(Long orderAmountCent) {
//        DecimalFormat df = new DecimalFormat("#.00");
//        //分转元
//        double s = ((double) orderAmountCent / 100);
//        this.orderAmount = Double.valueOf(df.format(s));
        this.orderAmount = NumberUtils.fenToYuan(orderAmountCent);
        this.orderAmountCent = orderAmountCent;
    }

    public Long getShippingFeeCent() {
        return shippingFeeCent;
    }

    public void setShippingFeeCent(Long shippingFeeCent) {
//        DecimalFormat df = new DecimalFormat("#.00");
        //分转元
        if (shippingFeeCent == null) {
            shippingFeeCent = 0L;
        }
//        Double s = (double) (shippingFeeCent / 100);
//        this.shippingFee = Double.valueOf(df.format(s));
        this.shippingFee = Double.valueOf(NumberUtils.fenToYuan(shippingFeeCent));
        this.shippingFeeCent = shippingFeeCent;
    }

    public Long getOrderTotalPriceCent() {
        return orderTotalPriceCent;
    }

    public void setOrderTotalPriceCent(Long orderTotalPriceCent) {
//        DecimalFormat df = new DecimalFormat("#.00");
//        //分转元
//        double s = ((double) orderTotalPriceCent / 100);
//        this.orderTotalPrice = Double.valueOf(df.format(s));
        this.orderTotalPrice = NumberUtils.fenToYuan(orderTotalPriceCent);
        this.orderTotalPriceCent = orderTotalPriceCent;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDetailedAddress() {
        return detailedAddress;
    }

    public void setDetailedAddress(String detailedAddress) {
        this.detailedAddress = detailedAddress;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public OrderAddressDto getAddressInfo() {
        return addressInfo;
    }

    public void setAddressInfo(OrderAddressDto addressInfo) {
        this.addressInfo = addressInfo;
    }


    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Integer getRefundNum() {
        return refundNum;
    }

    public void setRefundNum(Integer refundNum) {
        this.refundNum = refundNum;
    }

    public String getMallsOrgId() {
        return mallsOrgId;
    }

    public void setMallsOrgId(String mallsOrgId) {
        this.mallsOrgId = mallsOrgId;
    }

    public String getMallsBelongId() {
        return mallsBelongId;
    }

    public void setMallsBelongId(String mallsBelongId) {
        this.mallsBelongId = mallsBelongId;
    }

    public Long getMallsGoodsId() {
        return mallsGoodsId;
    }

    public void setMallsGoodsId(Long mallsGoodsId) {
        this.mallsGoodsId = mallsGoodsId;
    }

    public Date getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(Date deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public Date getFinnshedTime() {
        return finnshedTime;
    }

    public void setFinnshedTime(Date finnshedTime) {
        this.finnshedTime = finnshedTime;
    }

    public String getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(String couponAmount) {
        this.couponAmount = couponAmount;
    }

    public void setOrderTotalPrice(String orderTotalPrice) {
        this.orderTotalPrice = orderTotalPrice;
    }

    public int getIsVirtual() {
        return isVirtual;
    }

    public void setIsVirtual(int isVirtual) {
        this.isVirtual = isVirtual;
    }
}